package com.String.Demo;

import java.util.ArrayList;

public class ArrayListDemo {
    public static void main(String[] args) {
        ArrayList<String> names = new ArrayList<>();
        names.add("西门吹雪");
        names.add("独孤不败");
        names.add("东方求败");
        System.out.println(names);

        System.out.println(names.get(0));
        System.out.println(names.get(1));
        System.out.println(names.get(2));

        for (int i = 0; i < names.size() ; i++) {
            String name = names.get(i);
            System.out.println(name);
            System.out.println(names.get(i));
        }
    }
}
